<link rel="stylesheet" type="text/css" href="/css/support.css" />
<?php if($this->error == 1){?>
<center><?php echo $this->textError1;?></center>
<?php } else if($this->error==2) {?>
<center><?php echo $this->textError10;?></center>
<?php }else{?>
<h2><?php echo $this->textTitle;?></h2>
<input type = "text"  name="title" id="title" maxlength="20" value="<?php echo $this->title;?>" class="info"></input>
<br>
<h2><?php echo $this->textSort;?></h2>
<input type = "text" name="sort"  id="sort" maxlength="11" value="<?php echo $this->sort;?>" class="info"></input>
<div style="clear:both;	float:left;	width:100%;height: 30px; ">
	<input type="button" style="float: right; margin: 10px; width: 60px;height: 30px; color:white; border: none; background-image: url('../images/btn_short.png');" value="<?php echo $this->textSave;?>" onclick = "EditModule('<?php echo $this->name;?>');">
</div>

<script type="text/javascript">
function EditModule(module_code)
{ 
	
	var _title= document.getElementById("title").value ;
	var _limit= 2;
	var _sort= document.getElementById("sort").value ;
	
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{	
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			if(xmlhttp.responseText == "-1")
			{
				alert(<?php echo "'".$this->textError1."'";?>);
			}
			else if(xmlhttp.responseText == "-2" )
			{
				alert(<?php echo "'".$this->textError2."'";?>);
			}
			else if(xmlhttp.responseText == "-3")
			{
				alert(<?php echo "'".$this->textError3."'";?>);
			}
			else if(xmlhttp.responseText == "-4")
			{
				alert(<?php echo "'".$this->textError4."'";?>);
			}
			else if(xmlhttp.responseText == "-5")
			{
				alert(<?php echo "'".$this->textError5."'";?>);
			}
			else
			{	
				window.parent.$.prettyPhoto.close();
				window.top.location.reload();
			}
		}	
	};
	var url = "/supportonline/clickchange/edit?name="+module_code+"&sort="+_sort+"&title="+_title+"&limit=2";
	xmlhttp.open("GET",url,true);	
	xmlhttp.send();
	return false;
}
</script>

<?php }?>